import request from '@/utils/request'
/** 用户登录 */
export const userLoginService = ({ phonenumber, code, imageCode }) =>
  request.post('/app/users/login', { phonenumber, code, imageCode })

// 获取用户信息
export const userGetInfoService = () => request.get('/app/users/userinfo')

// 用户注册
export const userRegisterService = (username, password, repassword) =>
  request.post('/users/reg', { username, password, repassword })


export const userUpdateInfoService = (data) => request.put('/my/userinfo', data)
export const userUpdatePasswordService = (data) =>
  request.patch('/my/updatepwd', {
    old_pwd: data.oldPassword,
    new_pwd: data.newPassword,
    re_pwd: data.confirmPassword
  })
